<?php
	session_start();	
?>

<?php
	if( $_SESSION["admin"] != "" )
	{
?>

<?php
    include_once("process/gifcard.php");
	$gifcard = new gifcard();
	
	if( $_GET["com"] == "gifcard" && $_GET["func"] == "update" && isset($_GET["id"]))
	{
		$row = $gifcard->GetOneGifcard($_GET['id']);
         $id = $row['GiftCardID'];
            if($row['ActiveYN'] == 1)
            {
			     $gifcard->UpdateGifcard($id, '0');
            }
            else
            {
                $gifcard->UpdateGifcard($id, '1');
            }
         	echo '<meta http-equiv="Refresh" content="0;URL=index.php?com=gifcard" />';
			return;
	}
	else
	{
		echo '<meta http-equiv="Refresh" content="0;URL=index.php?com=gifcard" />';
	}	
	}
   else
	{
		echo "<meta http-equiv='refresh' content='0; url=login.php' />";
	}
?>